<template>
	<div>
		<div class="layout-breadcrumb">
			<Breadcrumb>
			    <BreadcrumbItem to="/">首页</BreadcrumbItem>
			    <BreadcrumbItem href="">系统配置</BreadcrumbItem>
			    <BreadcrumbItem href="">记录</BreadcrumbItem>
			    <BreadcrumbItem href="/config/record/systemlog">系统日志</BreadcrumbItem>
			</Breadcrumb>
		</div>
		<div class="layout-content">
		    <div class="layout-content-main">
		    	<BaseTable ref="table" :url="table.url" :header="table.header" ></BaseTable>
		    </div>
		</div>
	</div>
</template>
<script>
import {Breadcrumb,Button} from 'view-design';

import BaseTable  from 'admin/components/common/table/base';

export default{
	components:{
        Breadcrumb,
        'BreadcrumbItem' : Breadcrumb.Item,
        BaseTable,
    },
    data () {
        return {
        	table:{
        		url : '/config/record/systemlog/view/list',
        		header: []
        	}
        }
    },
    methods:{
    	
    },
    created:function(){
    	this.table.header =  [
            {
		        title: '文件名',
		        key: 'name',
		        render:(h,params) =>{
		        	return h('a',{
		        		attrs :{
		        			href: '/config/record/systemlog/view/one?name='+params.row.name,
		        			target : '_blank'
		        		}
		        	},params.row.name);
		        }
		    },
		    {
		        title: '操作',
		        key: 'action',
		        width: 150,
		        align: 'center',
		        render: (h, params) => {
		            return h('div', [
		            	!this.$store.getters.per.config_record_systemlog_delete ? '' :
		                h(Button, {
		                    props: {
		                        type: 'error',
		                        size: 'small'
		                    },
		                    on: {
		                        click: () => {
		                        	this.$Modal.confirm({
					                    title: '你确定要删除吗？',
					                    content: '一旦删除无法恢复',
					                    onOk: () => {
					                        this.Axios.Configs.Record.SystemLog.Del({name:params.row.name})
								            .then(res =>{
								                if(!res) return false;
								                this.$refs.table.tableRowDel = true;
								                this.$refs.table.tableData();
								            })
					                    }
					                });
		                        }
		                    }
		                }, '删除')
		            ]);
		        }
		    }
        ];
    },
    mounted:function(){
        this.$store.dispatch('CHANGE_ROUTE',{name:'系统日志',route:'/config/record/systemlog',action:1,closable:true});
    },
}
</script>